package ljl.bilibili.mapper.video.video_production.upload;
import com.github.yulichang.base.MPJBaseMapper;
import ljl.bilibili.entity.video.video_production.upload.VideoData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface VideoDataMapper extends MPJBaseMapper<VideoData> {
    @Update("update video_data set play_count=play_count+1 where video_id=#{videoId}")
    void addPlayCount(Integer videoId);

    @Update("update video_data set like_count=like_count+1 where video_id=#{videoId}")
    void addLikeCount(Integer videoId);

    @Update("update video_data set like_count=like_count-1 where video_id=#{videoId}")
    void reduceLikeCount(Integer videoId);

    @Update("update video_data set comment_count=comment_count+1 where video_id=#{videoId}")
    void addCommentCount(Integer videoId);

    @Update("update video_data set comment_count=comment_count-1 where video_id=#{videoId}")
    void reduceCommentCount(Integer videoId);

    @Update("update video_data set collect_count=collect_count-1 where video_id=#{videoId}")
    void reduceCollectCount(Integer videoId);

    @Update("update video_data set collect_count=collect_count+1 where video_id=#{videoId}")
    void addCollectCount(Integer videoId);

    @Update("update video_data set danmaku_count=danmaku_count+1 where video_id=#{videoId}")
    void addDanmakuCount(Integer videoId);
}
